1. Field of the Disclosure
The present disclosure relates generally to methods and systems for implementing time-locks in a data storage.
2. Description of Related Art
In a network environment, multiple servers may access and utilize a shared storage device. When two servers attempt to access the shared storage device at the same time, conflicts may occur. For example, duplicate reports may be generated for the same operation, or conflicting operations may be implemented by the two servers in the shared storage device. Thus, a mechanism is needed to ensure that only one server has exclusive access to the shared storage device at one time. Nevertheless, if a server having exclusive access to the shared storage device is shut down before the server surrenders its exclusive access to the shared storage device, the shared storage device may be locked up indefinitely, such that other servers cannot gain access to the shared storage device. A time based access may be granted to the server to prevent indefinite locked up of the shared storage device. Nevertheless, time may not be synchronized across the servers. Moreover, even if time synchronization across the servers is achieved, communications among the servers and the shared storage device may cause time delays that make it difficult to ensure the use of the same time across multiple servers and to ensure exclusive access to only one server at a time.
In a library described in http://search.cpan.org/˜ronaldws/LockFile-NetLock-0.29/NetLock.pm, a directory name in ftp is used to create a lock to a storage. Nevertheless, after the lock using the directory name is created, the lock must be erased after access to the storage is terminated. When a lock is left behind because its owner is terminated unexpectedly and when two servers attempt to recover the left-behind lock by erasing the left-behind lock to gain access to the storage, the two servers may erase each other's lock, and each of the two servers may assume that it owns the lock for exclusive access to the shared storage device.